手机adb本机,Termux安装adb工具 | 您所在的位置:网站首页 › 手机端adb软件 usb调试 › 手机adb本机,Termux安装adb工具 |
无root需要usb连接一次电脑开启adb链接。之后不重启手机可持续本地adb,不再需要电脑。 安装与配置termux推荐安装开源版本:Termux (带有软件包的终端模拟器) - https://f-droid.org/packages/com.termux 网页打开链接选择 DownloadApk 118为最新版,推荐117较为稳定且兼容高安卓版本 打开termux下文“$ ”为提示符,其后为需要输入的命令行。 授予存储空间权限 $ temux-setup-storage 同时会挂载内部存储到~/storage 目录 换源加快下载与更新速度$ termux-change-repo 触屏选中需要更换的源,必选 Main …。 推荐触屏选中 Tsinghua 清华源,然后点底部 OK 确认 有关清华源的帮助 https://mirror.tuna.tsinghua.edu.cn/help/termux/ 更新软件源$ pkg update $ pkg upgrade 下载基础软件$ pkg install git vim perl nodejs-lts wget curl nano cronie moreutils -y 安装adb工具转载自 https://github.com/rendiix/termux-adb-fastboot 轻松在 termux 通过 apt 安装 adb工具。不需要 ROOT权限。 安装方法: $ git clone https://github.com/rendiix/termux-adb-fastboot.git 网络问题不能访问github,建议科学上网正常情况正常情况下载成功切换目录 $ cd termux-adb-fastboot 切换到目录开始安装 安装过程需要输y,然后按键盘回车确认 $ bash install.sh 运行安装adb安装过程需要输y,然后按键盘回车确认在线安装: $ curl -s https://raw.githubusercontent.com/rendiix/termux-adb-fastboot/master/install.sh | bash 未测试,我用的前文安装方法 安装成功$ adb 如图则已成功安装 adb和fastboot工具 打开USB调试、无线调试 adb连接本机无root,数据线连电脑开启adb连接。 手机需要开 USB文件传输模式,电脑执行adb devices连接手机adbd 完成后跳到下一步找本机 IP地址 有root情况 开发者选项-USB配置:RNDIS (USB网络) 授予termux root权限 $ su “# ”提示在本机root状态 # stop adbd # setprop service.adb.tcp.port 5555 # start adbd # exit 找到本机的IP关于手机 - 状态信息 - IP 地址 开发者选项 - 无线调试- IP 地址和端口 本地adb$ adb connect IP地址 默认5555端口,如果设置了端口号则 adb connect IP地址:端口 adb 和 fastboot 命令示例 adb命令: $ adb devices :列出 adb 设备并显示序列号 $ adb reboot :重启设备 $ adb reboot bootloader :重启到 fastboot 模式 $ adb reboot recovery :重启到 recovery 模式 $ adb reboot fastboot :重启到 fastbootd 模式 $ adb reboot edl :重启到 edl 模式 $ --adb shell命令: $ adb shell am monitor :点击启动应用活动以显示应用包名 $ adb shell pm disable-user ^ :禁用 app $ adb shell pm enable ^ :恢复已禁用的 app $ adb shell pm uninstall --user 0 ^ :为主用户卸载系统 app $ adb shell pm install-existing --user 0 ^ :恢复上条命令卸载的系统 app fastboot命令: $ fastboot devices :列出 fastboot 设备 $ fastboot reboot :重启设备 $ fastboot reboot-bootloader :重启到 fastboot 模式 $ fastboot flash ^ ^ :刷写分区 $ fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img :关闭 AVB $ fastboot oem reboot-^ :重启到相应模式 $ fastboot flashing unlock :解锁 BL $ fastboot flashing lock :回锁 BL $ fastboot oem device-info :查看解锁状态 TWRP命令: $ adb push app-release.apk /magisk.zip :把面具推送到根目录 adb shell twrp install /magisk.zip :刷入面具安装包 $ 卸载面具: $ adb push app-release.apk /uninstall.zip :把面具卸载包推送到根目录 adb shell twrp install /uninstall.zip :刷入面具卸载包 更多 adb 命令请浏览 Android 开发者网页:https://developer.android.google.cn/studio/command-line/adb?hl=zh-cn 有关adb命令的帮助 https://github.com/mzlogin/awesome-adb |
CopyRight 2018-2019 实验室设备网 版权所有 |